//
//  EveryNode.hpp
//  Simulation
//
//  Created by Christopher Kemsley on 3/3/12.
//  Copyright (c) 2012 iAppolopolis. All rights reserved.
//

#ifndef Simulation_EveryNode_hpp
#define Simulation_EveryNode_hpp

#include "Model.hpp"
#include "Settings.hpp"
#include "Types.hpp"



struct	EveryModelSettings : public Sim::Settings
{
	std::string		identifier ;	// "B"
	Sim::Location	location ;		// "1,1"
	Sim::Distance	txRange ;		// "18"
	
	
	EveryModelSettings	( std::string const & name )
	:	Sim::Settings(name)
	,	identifier()
	,	location()
	,	txRange(0)
		{
		add ( "id" , identifier ) ;
		add ( "location" , location ) ;
		add ( "txRange" , txRange ) ;
		}
	
	virtual void validate ()
		{
		if ( identifier.size() != 1 )
			ThrowException ( "EveryModelSettings" , "Identifier's length isn't 1!" , __FILE__,__LINE__ ) ;
		if ( txRange == 0 )
			ThrowException ( "EveryModelSettings" , "Range is zero!" , __FILE__,__LINE__ ) ;
		}
} ;


template <typename SettingsType>
struct	EveryModel : public Sim::ConfiguredModel<SettingsType>
{
	EveryModel	( Sim::ModelVariant const & identity )
	:	Sim::ConfiguredModel<SettingsType>	( identity )
		{
		
		}
} ;



#endif
